#include "WorldProcess.h"
#include "ScriptMgr.h"
#include "NGLog.h"
#include "GatewayOpcodes.h"
#include "GameUserCommand.h"
#include "ScriptWorldProcess.h"
#include "OpcodesEx.h"
#include "GameServerCommand.h"
#include "CenterBattleManager.h"
#include "CenterBattleLogManager.h"
#include "url.h"
#include "json/json.h"
#include "nxweb/nxweb.h"
#include "MD5.h"

#include "GameDefine.h"
#include LOGIC_MGR_PATH

#include "GameDataEnum.h"

#define SECUREKEY "mef3mervzl1SykohhufmdkhvdbCpokkt"

void register_Club_world_process(ScriptMgr * mgr)
{
	///////////////////////////////// 俱乐部相关 /////////////////////////////////
	//CMSG_CLUB_NORMALINFO = 0x2100,	// 俱乐部资料
	mgr->register_server_process(CMSG_CLUB_NORMALINFO,script_world_process_club_info);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_NORMALINFO,"script_world_process_club_info");
	//CMSG_CLUB_HALLINFO = 0x2101,		// 俱乐部大厅信息
	mgr->register_server_process(CMSG_CLUB_HALLINFO,script_world_process_club_totalinfo);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_HALLINFO,"script_world_process_club_totalinfo");
	//CMSG_CLUB_LIST = 0x2102,			// 请求俱乐部列表（地区查询，名字查询，自己的）
	mgr->register_server_process(CMSG_CLUB_LIST,script_world_process_club_listinfo);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_LIST,"script_world_process_club_listinfo");
	//CMSG_CLUB_CREATE = 0x2103,		// 创建俱乐部
	mgr->register_server_process(CMSG_CLUB_CREATE,script_world_process_club_create);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CREATE,"script_world_process_club_create");
	//CMSG_CLUB_REQUIREJOIN = 0x2104,	// 请求加入俱乐部
	mgr->register_server_process(CMSG_CLUB_REQUIREJOIN,script_world_process_club_requirejoin);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REQUIREJOIN,"script_world_process_club_requirejoin");
	//CMSG_CLUB_REVIEW = 0x2105,		// 审核操作（申请加入/带入金额）
	mgr->register_server_process(CMSG_CLUB_REVIEW,script_world_process_club_review);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REVIEW,"script_world_process_club_review");
	//CMSG_CLUB_REVIEWLOGS = 0x2106,	// 审核历史（加入/带入）
	mgr->register_server_process(CMSG_CLUB_REVIEWLOGS,script_world_process_club_reviewlogs);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REVIEWLOGS,"script_world_process_club_reviewlogs");
	//CMSG_CLUB_TAKEIN = 0x2107,		// 玩家请求带入金币
	mgr->register_server_process(CMSG_CLUB_TAKEIN,script_world_process_club_takein);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_TAKEIN,"script_world_process_club_takein");
	//CMSG_CLUB_RETURNCOINS = 0x2108,	// 退分
	mgr->register_server_process(CMSG_CLUB_RETURNCOINS,script_world_process_club_returncoins);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_RETURNCOINS,"script_world_process_club_returncoins");
	//CMSG_CLUB_BUYPLAYERRANK = 0x2109,	// 购买会员
	mgr->register_server_process(CMSG_CLUB_BUYPLAYERRANK,script_world_process_club_buyplayerrank);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_BUYPLAYERRANK,"script_world_process_club_buyplayerrank");
	//CMSG_CLUB_BUYCLUBRANK = 0x210A,	// 购买俱乐部星级
	mgr->register_server_process(CMSG_CLUB_BUYCLUBRANK,script_world_process_club_buyclubrank);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_BUYCLUBRANK,"script_world_process_club_buyclubrank");
	//CMSG_CLUB_EXITCLUB = 0x210B,		// 退出公会
	mgr->register_server_process(CMSG_CLUB_EXITCLUB,script_world_process_club_exit);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_EXITCLUB,"script_world_process_club_exit");
	//CMSG_CLUB_CHANGEQUANXIAN = 0x210C,// 权限调整
	mgr->register_server_process(CMSG_CLUB_CHANGEQUANXIAN,script_world_process_club_changequanxian);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHANGEQUANXIAN,"script_world_process_club_changequanxian");
	//CMSG_CLUB_KICKOUT = 0x210D,		// 踢出玩家
	mgr->register_server_process(CMSG_CLUB_KICKOUT,script_world_process_club_kickout);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_KICKOUT,"script_world_process_club_kickout");
	//CMSG_CLUB_CHATLIST = 0x210E,		// 聊天列表信息
	mgr->register_server_process(CMSG_CLUB_CHATLIST,script_world_process_club_chatlist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHATLIST,"script_world_process_club_chatlist");
	//CMSG_CLUB_CHAT = 0x210F,			// 发送聊天
	mgr->register_server_process(CMSG_CLUB_CHAT,script_world_process_club_chat);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHAT,"script_world_process_club_chat");
	//CMSG_CLUB_TAKEINMEESAGELIST = 0x2110,		// 俱乐部带入消息列表
	mgr->register_server_process(CMSG_CLUB_TAKEINMEESAGELIST,script_world_process_club_takeinmessagelist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_TAKEINMEESAGELIST,"script_world_process_club_takeinmessagelist");
	//CMSG_CLUB_BATTLELIST = 0x2111,		// 请求俱乐部组局列表
	mgr->register_server_process(CMSG_CLUB_BATTLELIST, script_world_process_club_battlelist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_BATTLELIST, "script_world_process_club_battlelist");
	//CMSG_CLUB_MYCLUBBATTLELIST = 0x2112,// 发现自己俱乐部组局列表
	mgr->register_server_process(CMSG_CLUB_MYCLUBBATTLELIST, script_world_process_club_discoverbattlelist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_MYCLUBBATTLELIST, "script_world_process_club_discoverbattlelist");
	//CMSG_CLUB_CHENGJIPAIHANG = 0x2113,	// 俱乐部成绩排行
	mgr->register_server_process(CMSG_CLUB_CHENGJIPAIHANG, script_world_process_club_chengjiorder);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHENGJIPAIHANG, "script_world_process_club_chengjiorder");
	// CMSG_CLUB_ROOMLIST = 0x2114,		// 房间列表
	mgr->register_server_process(CMSG_CLUB_ROOMLIST, script_world_process_club_roomlist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_ROOMLIST, "script_world_process_club_roomlist");
	// CMSG_CLUB_CREATEROOM = 0x2115,	// 创建房间
	mgr->register_server_process(CMSG_CLUB_CREATEROOM, script_world_process_club_createroom);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CREATEROOM, "script_world_process_club_createroom");
	// CMSG_CLUB_BUYGOODS = 0x2117,		// 购买商品
	mgr->register_server_process(CMSG_CLUB_BUYGOODS, script_world_process_club_buygoods);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_BUYGOODS, "script_world_process_club_buygoods");
	// CMSG_CLUB_PLAYERINFO = 0x2118,	// 俱乐部玩家信息
	mgr->register_server_process(CMSG_CLUB_PLAYERINFO, script_world_process_club_playerinfo);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_PLAYERINFO, "script_world_process_club_playerinfo");
	// CMSG_CLUB_CURRSCORE = 0x02119,	// 俱乐部当前积分
	mgr->register_server_process(CMSG_CLUB_CURRSCORE, script_world_process_club_currscore);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CURRSCORE, "script_world_process_club_currscore");
	// CMSG_CLUB_DISSOLVE = 0x211A,		// 解散俱乐部
	mgr->register_server_process(CMSG_CLUB_DISSOLVE, script_world_process_club_dissolve);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_DISSOLVE, "script_world_process_club_dissolve");
	// CMSG_CLUB_CHANGECLUBINFO = 0x211B,	// 修改俱乐部信息
	mgr->register_server_process(CMSG_CLUB_CHANGECLUBINFO, script_world_process_club_changeinfo);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHANGECLUBINFO, "script_world_process_club_changeinfo");
	
	// CMSG_CLUB_REMARKINFO = 0x211C,			// 玩家备注信息
	mgr->register_server_process(CMSG_CLUB_REMARKINFO, script_world_process_club_playerremarkinfo);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REMARKINFO, "script_world_process_club_playerremarkinfo");
	// CMSG_CLUB_ADDREMARK = 0x211D,			// 设置玩家备注信息
	mgr->register_server_process(CMSG_CLUB_ADDREMARK, script_world_process_club_setplayerremark);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_ADDREMARK, "script_world_process_club_setplayerremark");
	// CMSG_CLUB_CHANGEGROUPNAME = 0x211E,		// 修改备注分组名称
	mgr->register_server_process(CMSG_CLUB_CHANGEGROUPNAME, script_world_process_club_changegrouplabelname);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHANGEGROUPNAME, "script_world_process_club_changegrouplabelname");	
	// CMSG_CLUB_ADDREMARKLABEL = 0x211F,		// 添加标签名称
	mgr->register_server_process(CMSG_CLUB_ADDREMARKLABEL, script_world_process_club_addlabelname);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_ADDREMARKLABEL, "script_world_process_club_addlabelname");
	// CMSG_CLUB_REMOVEREMARKLABEL = 0x2120,	// 移除标签名称
	mgr->register_server_process(CMSG_CLUB_REMOVEREMARKLABEL, script_world_process_club_removelavelname);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REMOVEREMARKLABEL, "script_world_process_club_removelavelname");
	// CMSG_CLUB_REMOVEREMARKPLAYER = 0x2121,	// 移除备注玩家信息
	mgr->register_server_process(CMSG_CLUB_REMOVEREMARKPLAYER, script_world_process_club_removeremark);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REMOVEREMARKPLAYER, "script_world_process_club_removeremark");
	// CMSG_CLUB_PLAYERDETAILS = 0x2122,		// 俱乐部玩家详细信息
	mgr->register_server_process(CMSG_CLUB_PLAYERDETAILS, script_world_process_club_playerdetails);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_PLAYERDETAILS, "script_world_process_club_playerdetails");
	// CMSG_CLUB_CHOOSESEATBATTLELIST = 0x2123,	// 俱乐部选座房牌局列表
	mgr->register_server_process(CMSG_CLUB_CHOOSESEATBATTLELIST, script_world_process_club_chooseseatbattlelist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CHOOSESEATBATTLELIST, "script_world_process_club_chooseseatbattlelist");
	// CMSG_CLUB_BATTLEHISTORYLOG = 0x2124,		// 俱乐部历史战绩
	mgr->register_server_process(CMSG_CLUB_BATTLEHISTORYLOG, script_world_process_club_battlehistorylogs);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_BATTLEHISTORYLOG, "script_world_process_club_battlehistorylogs");
	//CMSG_CLUB_REVIEWCOUNT = 0x2125,			// 俱乐部审核消息数量（用于显示审核旁边的红点）
	mgr->register_server_process(CMSG_CLUB_REVIEWCOUNT, script_world_process_club_reviewcount);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_REVIEWCOUNT, "script_world_process_club_reviewcount");
	//CMSG_CLUB_JOINMEESAGELIST = 0x2126,		// 俱乐部带入消息列表
	mgr->register_server_process(CMSG_CLUB_JOINMEESAGELIST, script_world_process_club_joinmessagelist);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_JOINMEESAGELIST, "script_world_process_club_joinmessagelist");
	// CMSG_CLUB_EXITCOINSLOGS = 0x2127,		// 退分历史
	mgr->register_server_process(CMSG_CLUB_EXITCOINSLOGS, script_world_process_club_exitcoinslogs);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_EXITCOINSLOGS, "script_world_process_club_exitcoinslogs");
	// CMSG_CLUB_MTFCLUBINFO = 0x2129,			// 满天星俱乐部信息
	mgr->register_server_process(CMSG_CLUB_MTFCLUBINFO, script_world_process_club_mtxclubinfo);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_MTFCLUBINFO, "script_world_process_club_mtxclubinfo");
	// CMSG_CLUB_HISTORYCHENGJI = 0x212A,		// 俱乐部成绩总汇
	mgr->register_server_process(CMSG_CLUB_HISTORYCHENGJI, script_world_process_club_historybattlechengji);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_HISTORYCHENGJI, "script_world_process_club_historybattlechengji");
	// CMSG_CLUB_CREATEMTF = 0x212B,			// 创建满天飞俱乐部
	mgr->register_server_process(CMSG_CLUB_CREATEMTF, script_world_process_club_createmtf);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CREATEMTF, "script_world_process_club_createmtf");
	// CMSG_CLUB_LISTMTF = 0x212C,				// 俱乐部列表-满天飞（2 名字/ID 3 自己的）
	mgr->register_server_process(CMSG_CLUB_LISTMTF, script_world_process_club_listinfomtf);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_LISTMTF, "script_world_process_club_listinfomtf");
	
	// CMSG_CLUB_CREATEFASTMODE = 0x212D,		// 创建快速开房配置
	mgr->register_server_process(CMSG_CLUB_CREATEFASTMODE, script_world_process_club_createfastmode);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_CREATEFASTMODE, "script_world_process_club_createfastmode");
	// CMSG_CLUB_DELETEFASTMODE = 0x212E,		// 删除快速开房配置
	mgr->register_server_process(CMSG_CLUB_DELETEFASTMODE, script_world_process_club_deletefastmode);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_DELETEFASTMODE, "script_world_process_club_deletefastmode");
	// CMSG_CLUB_GETFASTMODE = 0x212F,			// 获取快速开房配置
	mgr->register_server_process(CMSG_CLUB_GETFASTMODE, script_world_process_club_getfastmode);
	Log.Debug("World Process", "Register opcode 0x%02x Process:[%s]",CMSG_CLUB_GETFASTMODE, "script_world_process_club_getfastmode");
	
	///////////////////////////////// 俱乐部相关 /////////////////////////////////
}
//-----------------------------------------------------------------------


